package main

import "fmt"

type Sayer interface {
	say()
}
type Runner interface {
	run()
}
type sleeper interface {
	sleep()
}

// 定义猫类型
type Cat struct{}

//猫的动作

func (catInstance Cat) say() {
	fmt.Println("喵喵喵")
}

func (catInstance Cat) run() {
	fmt.Println("睡眠中")
}

// 猫的动作：睡觉
func (catInstance Cat) sleep() {
	fmt.Println("睡眠中")
}

func main() {
	var anyAnimalSayer Sayer
	var anyAnimalRunner Runner
	var anyAnimalSleeper sleeper
	catOne := Cat{}
	anyAnimalSayer = &catOne
	anyAnimalRunner = &catOne
	anyAnimalSleeper = &catOne
	anyAnimalSayer.say()
	anyAnimalRunner.run()
	anyAnimalSleeper.sleep()
}
